<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>兑换记录</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>
		<link rel="stylesheet" href="../css/main.css" />
	</head>
	<body>
		<div id="app">
			<img src="../images/null.jpg" width="100%" v-show="onOff">
			<div class="recordsCh" v-for="item in changes" v-show="!onOff">
				{{item.creditcontent}}
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../js/vue.js" ></script>
	<script type="text/javascript" src="../js/rem.js" ></script>
	<script type="text/javascript" src="../js/axios.min.js" ></script>
	<script>
		new Vue({
			el:"#app",
			data:{
				onOff:false,
				openId:"",
				changes:[
//					{id:1,content:"您于2019-02-01  20：00 花费299积分成功兑换乐高玩具一个。"},
//					{id:2,content:"您于2019-02-01  20：00 花费299积分成功兑换乐高玩具一个。"},
//					{id:3,content:"您于2020-02-01  20：00 花费299积分成功兑换乐高玩具一个。"},
//					{id:4,content:"您于2019-02-01  20：00 花费299积分成功兑换乐高玩具一个。"},
				]
			},
			created(){
				this.openId=localStorage.getItem("openId");
				axios.get("http://106.13.55.49/api/jdGoods/exchangehistory?openid="+this.openId)
				.then(data => {
					console.log(data);
					let datas=data.data.data;
					if(datas.length>0){
						for(let i in datas){
							this.changes.push(datas[i]);
						}
					}else{
						this.onOff=true;
					}
					
				});
			},
			methods:{
				
			}
			
		})
	</script>
</html>
